<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/2/20
 * Time: 10:21
 */

namespace app\mall\model;


use think\Model;

class GoodsSpike extends Model
{

    protected $table="b_goods_spike";
    protected $autoWriteTimestamp = true;


    public function getStatusTextAttr($value,$data)
    {
        $status = [0=>'未开始',1=>'活动中',2=>'已售罄',3=>'已结束'];
        return $status[$data['status']];
    }

    public function getStartTimeAttr($value){
        return date('Y-m-d H:i:s',$value);
    }
    public function getEndTimeAttr($value){
        return date('Y-m-d H:i:s',$value);
    }
}